#include<stdlib.h>
#include<time.h>
#include<vector>
#include<map>
#include"RBtree.h"
#include "Myset.h"
#include "MyMap.h"
void test(const ly::map<int, int>& mp) {
	auto it = mp.begin();
}
int main() {
	srand(time(0));
	ly::set<int> st;
	for (int i = 0; i < 100; i++) {
		st.insert(rand());
	}
	auto it = st.begin();
	++it;
	//*it = 9;
	for (auto& e : st) {
		cout << e << endl;
	}
	it = st.lower_bound(10000);
	if (it == st.end()) {
		cout << "end" << endl;
	}
	else {
		cout << *it << endl;
	}
	it = st.upper_bound(10000);
	if (it == st.end()) {
		cout << "end" << endl;
	}
	else {
		cout << *it << endl;
	}
	ly::map<int, int> mp;
	for (int i = 0; i < 100; i++) {
		mp.insert(rand());
	}
	auto mit = mp.begin();
	//++mit;
	//*it = 9;
	for (auto& e : mp) {
		cout << e.second << endl;
	}
	mit = mp.lower_bound(10000);
	if (mit == mp.end()) {
		cout << "end" << endl;
	}
	else {
		cout << (*mit).first << endl;
	}
	mit = mp.upper_bound(10000);
	if (mit == mp.end()) {
		cout << "end" << endl;
	}
	else {
		cout << (*mit).first << endl;
	}
	test(mp);
	return 0;
}